<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>


<!DOCTYPE HTML >
<html>
  <head>
    
	<link rel="stylesheet" type="text/css" href="image/back.css">
	<script type="text/javascript">

	function cailie(){

	var lieshu=document.getElementById("lieshu");
	var liezhi=lieshu.value;
	
	var form=document.createElement("form");
	 var submit=document.createElement("input");
	var caidan=document.getElementById("caidan");
	var div=document.createElement("div");
	div.id="div1";
	form.action="#";
	form.method="get";
	form.id="form1";
	submit.type="submit";
	submit.value="保存";
	caidan.appendChild(div);
	div.appendChild(form);
	var form1=document.getElementById("form1");
    
	if(form1.childNodes.length>0){
	for(var i=form1.childNodes.length-1;i>=0;i--){
	
	form1.removeChild(form1.childNodes[i]);
	
	
	}}else{}
	
	for(var j=0;j<liezhi;j++){
	
	 id_caiming="cm"+j;
	 id_caijia="cj"+j;
	 
	 caiming=document.createElement("input");
	 jiage=document.createElement("input");
	
	 caiming_span=document.createElement("span");
	 br=document.createElement("br");
	 caijia_span=document.createElement("span");
	 
	caiming_span.id=id_caiming;
	caijia_span.id=id_caijia;
	
	caiming.type="text";
	caiming.value="heh";
	caiming.id="caim";
	jiage.type="text";
	jiage.value="heh";
	jiage.id="jiage1";
	
	form1.appendChild(caiming);
	form1.insertBefore(caiming_span,caiming);
	
	
	
	form1.appendChild(caijia_span);
	form1.appendChild(jiage);
	
	
	
	form1.appendChild(br);
	
	document.getElementById(id_caiming).innerHTML="菜名：";
	document.getElementById(id_caijia).innerHTML="价格：";
	
	}
	form1.appendChild(submit);
	}
	</script>

  </head>
  
  <body onload="t()">
     <div id="caidanshuoming_1">
    
   <h4 id="d">菜单分类</h4>
   
  店名：<input type="text" name="leiming" id="leiming">特价数：<input type="text" name="lieshu" id="lieshu">
      <span onclick="cailie()">确认</span>
    
    <div id="caidan">
    
    
    
    
    </div>
    
    </div>
    
    
    
    
  </body>
</html>
